fix(transformer/styled-components): preserve spaces between consecutive interpolations in CSS minification#13346
Merged
graphite-app[bot] merged 1 commit intomainfrom Aug 28, 2025
Conversation
Member
Author
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
dbbad9a to
5ad0fa3
Compare
CodSpeed Instrumentation Performance ReportMerging #13346 will not alter performanceComparing Summary
Footnotes |
f9a7350 to
4b431b2
Compare
5ad0fa3 to
1fa4dac
Compare
overlookmotel
approved these changes
Aug 28, 2025
1fa4dac to
0c9f14c
Compare
4b431b2 to
cc3b0cf
Compare
Base automatically changed from
08-27-fix_transformer_legacy-decorator_emit_correct_metadata_types_for_enum
to
main
August 28, 2025 15:23
0c9f14c to
6c12d0c
Compare
Member
Merge activity
|
…ve interpolations in CSS minification (#13346) Fixes #13312 When minifying CSS in styled-components, spaces between consecutive interpolations were incorrectly removed, breaking CSS selectors. **Before:** `&:hover ${A}${B}` (incorrect - space removed) **After:** `&:hover ${A} ${B}` (correct - space preserved) The fix modifies the whitespace handling logic to preserve spaces between consecutive interpolations while still removing unnecessary spaces elsewhere.
6c12d0c to
7aff3b6
Compare
This was referenced Aug 28, 2025
graphite-app bot
pushed a commit
that referenced
this pull request
Aug 29, 2025
Fix a test case which was previously failing. The original test case in `babel-plugin-styled-components` *does* include a space before `height:`. Our copy of the test had got changed somehow (wrongly). This PR brings the case back into alignment with the original and, thanks to #13346, it now passes. https://github.com/styled-components/babel-plugin-styled-components/blob/4e2eb388d9c90f2921c306c760657d059d01a518/test/fixtures/minify-single-line-comments-with-interpolations/output.js#L26-L29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #13312
When minifying CSS in styled-components, spaces between consecutive interpolations were incorrectly removed, breaking CSS selectors.
Before:
&:hover ${A}${B}(incorrect - space removed)After:
&:hover ${A} ${B}(correct - space preserved)The fix modifies the whitespace handling logic to preserve spaces between consecutive interpolations while still removing unnecessary spaces elsewhere.